import wmi
import os
import time

c = wmi.WMI()
while True:
    if len(c.Win32_Process(name="jupyter-notebook.exe")) == 0:
        os.system("jupyter notebook --no-browser")
    time.sleep(10)